<div class="featured" class="mainElement">
    <div class="slide article">
        <div class="introText">
            <p class="flash">If your download did not start automatically or was blocked, click the link below to download manually:
                <br/><a class="downloadLink" href="http://download.neo4j.org/artifact?edition=community&version=<%= neo4jGA.version %>&distribution=zip">
                    <i class="icon icon-download-alt"></i> http://download.neo4j.org/artifact?edition=community&version=<%= neo4jGA.version %>&distribution=zip</a>
            </p>
        </div>
        <div class="content">
<p id="download_info_installer">If you downloaded the <strong>Windows Installer</strong>, run it and then use the <strong>Neo4j Launcher</strong> to
    start and stop your server. It is also available in the system tray.<br/>
    <strong>If you are running Windows 8 you might get a big
        <a target="_blank" href="http://3.bp.blogspot.com/-jgw-fUjJoMg/UkNVeyCuznI/AAAAAAAAAS0/SyNER0iF_K8/s1600/smartscreen_warning.png">blue warning</a> saying that "Windows protected your PC".
    Please select <a  target="_blank" href="http://4.bp.blogspot.com/-PLa08G5ryuI/UkNVe7BYBcI/AAAAAAAAAS4/NxHuqRijfaA/s1600/smartscreen_more.png">"More" and "Run Anyway"</a> to run the Neo4j installer.</strong>
</p>


<p id="download_info_distribution">If you downloaded the binary distribution, just extract the archive to a folder.<br/>
    <strong>Please</strong> make sure to have the latest <a href='http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html'>Oracle JDK 7 <i class="icon-download-alt"></i></a>
    installed, if not please follow that link.<br/>
    Open a terminal and change to the extracted folder (<code class="neo4j-version"></code>).<br/>
    Start the Neo4j server with <code>bin/neo4j start</code> from a terminal.<br/>
    <strong id="download_info_mac">Please ignore the MacOS dialog that prompts you to download <em>Java 6</em><br/></strong>
</p>
<p>Open <a href='http://localhost:7474'><code>http://localhost:7474</code></a></p>
<p>The new Neo4j Browser works well with <strong>Chrome, Firefox and Safari</strong>. Soon it will even work with <em>Internet Explorer</em>!<br/>
Please refer to the <a href="#browser-matrix" onclick="$('#browser-matrix').show()">browser matrix</a> for compatibility details.</p>
</div>
</div>
</div>

<% include browser_matrix %>

<div class="featured">
    <div class="slide page" style="min-height: 362px;">
        <div class="image">
            <a class="" href="/learn/online_course"><img class="thumbnail" src="http://assets.neo4j.org/img/still/online_training.jpg"></a>
        </div>
        <div class="text">
            <div class="caption">
                <h3 id="">Online Training: Getting Started with Neo4j</h3>

                <p class="introText">Learn Neo4j 2.0 at your own pace with this free online training course. Get started now!</p>
            </div>
        </div>

        <div class="clear"></div>
    </div>
    <a class="link action" href="/learn/online_course" target="_blank">Get started today »</a>
</div>

<div class="featured" class="mainElement">
    <div class="slide article">
        <div class="content">
<p>For the best developer experience, subscribe and stay informed about events, releases and technical articles on graphs and development with Neo4j.</p>
<div style="margin-top: -20px;margin-bottom: -10px;"><iframe style="visibility:visible;" src="http://www.neotechnology.com/wp-content/themes/Neo_Technology/signup.html" style="border:0;padding: 5;" width="300px" height="75px" frameborder="0" scrolling="no"></iframe></div>
</div>
</div>
</div>


<script type='text/javascript'>//<![CDATA[
$(document).ready(function() {
    var testing = getUrlVars()["test"] || null;
    var edition = getUrlVars()["edition"] || "community";
    var release = getUrlVars()["release"] || "<%= neo4jGA.version %>";
    var platform = getUrlVars()["platform"] || getUrlVars()["flavour"] || "unix";
    var architecture = getUrlVars()["architecture"] || "x64";
    var packaging = getUrlVars()["packaging"] || "zip";
    var suffix = "zip";
    var abTestToRedfox = Math.random() < 0.5;

    if (platform === 'unix' || platform === 'mac_linux') {
        suffix = 'tar.gz';
        packaging = 'tarball';
    }

    $(".neo4j-version").html(release);

    if (platform=="windows" && $('.bxslider').length) {
        $('.bxslider').bxSlider().goToNextSlide();
    }
    $(".dirName").text("neo4j-"+edition+"-"+release);

    if (packaging == "exe") {
        $("#download_info_distribution").hide();
    } else {
        $("#download_info_installer").hide();
    }
    if (platform !== "unix") {
        $("#download_info_mac").hide();
    }

    updateDownloadLink(null,true);

    function getUrlVars() {
        var vars = {};
        var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
            vars[key] = value;
        });
        return vars;
    }

    function updateDownloadLink(marketo_id,testing) {
        var marketo_idnum = marketo_id || 'notread';
        var method = "s3";
        var url_params = "?edition=" + edition + "&version=" + release + "&distribution=" + packaging + "&dlid=" + marketo_idnum;

        var displayLink = "http://dist.neo4j.org/neo4j-" + edition + "-" + release + "-" + platform +"." + suffix;
        var downloadLink = displayLink; //  + url_params;
        if (!release.match("SNAPSHOT") && abTestToRedfox) {
            downloadLink = "http://download.neo4j.org/artifact" + url_params;
            displayLink = downloadLink.replace(/&dlid.+/,"");
            method = "redfox";
        }
        if(platform=='windows') {
            if(packaging=='exe'){
                if(architecture=='x64') {
                    displayLink = "http://dist.neo4j.org/neo4j-"+edition+"_"+platform+"-"+architecture+"_"+release.replace(/\./g,"_")+"."+packaging;
                }   else {
                    displayLink = "http://dist.neo4j.org/neo4j-"+edition+"_"+platform+"_"+release.replace(/\./g,"_")+"."+packaging;
                }
            }
            downloadLink = displayLink; //  + url_params;
        }
        var logdata={release:release, platform: platform,edition:edition,link:downloadLink,architecture:architecture,packaging:packaging,marketo:marketo_id,method:method,action:"auto"};
//        if (console && console.log) console.log("Using downloadlink",downloadLink,logdata);
        log("download-prepare",logdata);

        var link = $(".downloadLink");
        link.attr("href",downloadLink).html("<i class='icon icon-download-alt'></i> "+displayLink).click(function() {
            logdata.action = "click";
            mktoMunchkinFunction('visitWebPage', { url: 'neo4j.org/download', params: url_params });
            ga('send','event','neo4j-download',downloadLink);
            _kmq.push(['identify', marketo_id ||'' ]); // todo identify people
            _kmq.push(['record', 'neo4j-download', logdata]);
            log("download-click",logdata);
        });
        if (testing===null) {
            ga('send','event','neo4j-download',downloadLink);
            _kmq.push(['identify', marketo_id ||'']); // todo identify people
            _kmq.push(['record', 'neo4j-download', logdata]);
            mktoMunchkinFunction('visitWebPage', { url: 'neo4j.org/download', params: url_params });
            window.location = downloadLink;
            log("download-auto",logdata);
        }
    }
    $.ajax("/api/marketo", {
        success: function(id) {
           // console.log("marketo-success",id)
            updateDownloadLink(id,testing);
        },
        error:function(err) {
           // console.log("marketo-error",err)
            updateDownloadLink(testing);
    }});

    $('.flash').delay(100).fadeOut().fadeIn('slow')
});
</script>
